Optimal. Leaf size=436 \[ \frac{(b+2 c x) \sqrt{a+b x+c x^2} \left (8 c^2 \left (2 a^2 f^2+12 a b e f+5 b^2 \left (2 d f+e^2\right )\right )-56 b^2 c f (a f+b e)-32 c^3 \left (a \left (2 d f+e^2\right )+4 b d e\right )+21 b^4 f^2+128 c^4 d^2\right )}{512 c^5}-\frac{\left (b^2-4 a c\right ) \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right ) \left (8 c^2 \left (2 a^2 f^2+12 a b e f+5 b^2 \left (2 d f+e^2\right )\right )-56 b^2 c f (a f+b e)-32 c^3 \left (a \left (2 d f+e^2\right )+4 b d e\right )+21 b^4 f^2+128 c^4 d^2\right )}{1024 c^{11/2}}+\frac{x \left (a+b x+c x^2\right )^{3/2} \left (-4 c f (5 a f+14 b e)+21 b^2 f^2+40 c^2 \left (2 d f+e^2\right )\right )}{160 c^3}+\frac{\left (a+b x+c x^2\right )^{3/2} \left (-8 c^2 \left (32 a e f+25 b \left (2 d f+e^2\right )\right )+28 b c f (7 a f+10 b e)-105 b^3 f^2+640 c^3 d e\right )}{960 c^4}+\frac{f x^2 \left (a+b x+c x^2\right )^{3/2} (8 c e-3 b f)}{20 c^2}+\frac{f^2 x^3 \left (a+b x+c x^2\right )^{3/2}}{6 c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.789373, antiderivative size = 436, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.185, Rules used = {1661, 640, 612, 621, 206} \[ \frac{(b+2 c x) \sqrt{a+b x+c x^2} \left (8 c^2 \left (2 a^2 f^2+12 a b e f+5 b^2 \left (2 d f+e^2\right )\right )-56 b^2 c f (a f+b e)-32 c^3 \left (a \left (2 d f+e^2\right )+4 b d e\right )+21 b^4 f^2+128 c^4 d^2\right )}{512 c^5}-\frac{\left (b^2-4 a c\right ) \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right ) \left (8 c^2 \left (2 a^2 f^2+12 a b e f+5 b^2 \left (2 d f+e^2\right )\right )-56 b^2 c f (a f+b e)-32 c^3 \left (a \left (2 d f+e^2\right )+4 b d e\right )+21 b^4 f^2+128 c^4 d^2\right )}{1024 c^{11/2}}+\frac{x \left (a+b x+c x^2\right )^{3/2} \left (-4 c f (5 a f+14 b e)+21 b^2 f^2+40 c^2 \left (2 d f+e^2\right )\right )}{160 c^3}+\frac{\left (a+b x+c x^2\right )^{3/2} \left (-8 c^2 \left (32 a e f+25 b \left (2 d f+e^2\right )\right )+28 b c f (7 a f+10 b e)-105 b^3 f^2+640 c^3 d e\right )}{960 c^4}+\frac{f x^2 \left (a+b x+c x^2\right )^{3/2} (8 c e-3 b f)}{20 c^2}+\frac{f^2 x^3 \left (a+b x+c x^2\right )^{3/2}}{6 c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1661
Rule 640
Rule 612
Rule 621
Rule 206
Rubi steps
\begin{align*} \int \sqrt{a+b x+c x^2} \left (d+e x+f x^2\right )^2 \, dx &=\frac{f^2 x^3 \left (a+b x+c x^2\right )^{3/2}}{6 c}+\frac{\int \sqrt{a+b x+c x^2} \left (6 c d^2+12 c d e x-3 \left (a f^2-2 c \left (e^2+2 d f\right )\right ) x^2+\frac{3}{2} f (8 c e-3 b f) x^3\right ) \, dx}{6 c}\\ &=\frac{f (8 c e-3 b f) x^2 \left (a+b x+c x^2\right )^{3/2}}{20 c^2}+\frac{f^2 x^3 \left (a+b x+c x^2\right )^{3/2}}{6 c}+\frac{\int \sqrt{a+b x+c x^2} \left (30 c^2 d^2+3 \left (20 c^2 d e-8 a c e f+3 a b f^2\right ) x+\frac{3}{4} \left (21 b^2 f^2-4 c f (14 b e+5 a f)+40 c^2 \left (e^2+2 d f\right )\right ) x^2\right ) \, dx}{30 c^2}\\ &=\frac{\left (21 b^2 f^2-4 c f (14 b e+5 a f)+40 c^2 \left (e^2+2 d f\right )\right ) x \left (a+b x+c x^2\right )^{3/2}}{160 c^3}+\frac{f (8 c e-3 b f) x^2 \left (a+b x+c x^2\right )^{3/2}}{20 c^2}+\frac{f^2 x^3 \left (a+b x+c x^2\right )^{3/2}}{6 c}+\frac{\int \left (\frac{3}{4} \left (160 c^3 d^2-21 a b^2 f^2+4 a c f (14 b e+5 a f)-40 a c^2 \left (e^2+2 d f\right )\right )+\frac{3}{8} \left (640 c^3 d e-105 b^3 f^2+28 b c f (10 b e+7 a f)-8 c^2 \left (32 a e f+25 b \left (e^2+2 d f\right )\right )\right ) x\right ) \sqrt{a+b x+c x^2} \, dx}{120 c^3}\\ &=\frac{\left (640 c^3 d e-105 b^3 f^2+28 b c f (10 b e+7 a f)-8 c^2 \left (32 a e f+25 b \left (e^2+2 d f\right )\right )\right ) \left (a+b x+c x^2\right )^{3/2}}{960 c^4}+\frac{\left (21 b^2 f^2-4 c f (14 b e+5 a f)+40 c^2 \left (e^2+2 d f\right )\right ) x \left (a+b x+c x^2\right )^{3/2}}{160 c^3}+\frac{f (8 c e-3 b f) x^2 \left (a+b x+c x^2\right )^{3/2}}{20 c^2}+\frac{f^2 x^3 \left (a+b x+c x^2\right )^{3/2}}{6 c}+\frac{\left (128 c^4 d^2+21 b^4 f^2-56 b^2 c f (b e+a f)-32 c^3 \left (4 b d e+a \left (e^2+2 d f\right )\right )+8 c^2 \left (12 a b e f+2 a^2 f^2+5 b^2 \left (e^2+2 d f\right )\right )\right ) \int \sqrt{a+b x+c x^2} \, dx}{128 c^4}\\ &=\frac{\left (128 c^4 d^2+21 b^4 f^2-56 b^2 c f (b e+a f)-32 c^3 \left (4 b d e+a \left (e^2+2 d f\right )\right )+8 c^2 \left (12 a b e f+2 a^2 f^2+5 b^2 \left (e^2+2 d f\right )\right )\right ) (b+2 c x) \sqrt{a+b x+c x^2}}{512 c^5}+\frac{\left (640 c^3 d e-105 b^3 f^2+28 b c f (10 b e+7 a f)-8 c^2 \left (32 a e f+25 b \left (e^2+2 d f\right )\right )\right ) \left (a+b x+c x^2\right )^{3/2}}{960 c^4}+\frac{\left (21 b^2 f^2-4 c f (14 b e+5 a f)+40 c^2 \left (e^2+2 d f\right )\right ) x \left (a+b x+c x^2\right )^{3/2}}{160 c^3}+\frac{f (8 c e-3 b f) x^2 \left (a+b x+c x^2\right )^{3/2}}{20 c^2}+\frac{f^2 x^3 \left (a+b x+c x^2\right )^{3/2}}{6 c}-\frac{\left (\left (b^2-4 a c\right ) \left (128 c^4 d^2+21 b^4 f^2-56 b^2 c f (b e+a f)-32 c^3 \left (4 b d e+a \left (e^2+2 d f\right )\right )+8 c^2 \left (12 a b e f+2 a^2 f^2+5 b^2 \left (e^2+2 d f\right )\right )\right )\right ) \int \frac{1}{\sqrt{a+b x+c x^2}} \, dx}{1024 c^5}\\ &=\frac{\left (128 c^4 d^2+21 b^4 f^2-56 b^2 c f (b e+a f)-32 c^3 \left (4 b d e+a \left (e^2+2 d f\right )\right )+8 c^2 \left (12 a b e f+2 a^2 f^2+5 b^2 \left (e^2+2 d f\right )\right )\right ) (b+2 c x) \sqrt{a+b x+c x^2}}{512 c^5}+\frac{\left (640 c^3 d e-105 b^3 f^2+28 b c f (10 b e+7 a f)-8 c^2 \left (32 a e f+25 b \left (e^2+2 d f\right )\right )\right ) \left (a+b x+c x^2\right )^{3/2}}{960 c^4}+\frac{\left (21 b^2 f^2-4 c f (14 b e+5 a f)+40 c^2 \left (e^2+2 d f\right )\right ) x \left (a+b x+c x^2\right )^{3/2}}{160 c^3}+\frac{f (8 c e-3 b f) x^2 \left (a+b x+c x^2\right )^{3/2}}{20 c^2}+\frac{f^2 x^3 \left (a+b x+c x^2\right )^{3/2}}{6 c}-\frac{\left (\left (b^2-4 a c\right ) \left (128 c^4 d^2+21 b^4 f^2-56 b^2 c f (b e+a f)-32 c^3 \left (4 b d e+a \left (e^2+2 d f\right )\right )+8 c^2 \left (12 a b e f+2 a^2 f^2+5 b^2 \left (e^2+2 d f\right )\right )\right )\right ) \operatorname{Subst}\left (\int \frac{1}{4 c-x^2} \, dx,x,\frac{b+2 c x}{\sqrt{a+b x+c x^2}}\right )}{512 c^5}\\ &=\frac{\left (128 c^4 d^2+21 b^4 f^2-56 b^2 c f (b e+a f)-32 c^3 \left (4 b d e+a \left (e^2+2 d f\right )\right )+8 c^2 \left (12 a b e f+2 a^2 f^2+5 b^2 \left (e^2+2 d f\right )\right )\right ) (b+2 c x) \sqrt{a+b x+c x^2}}{512 c^5}+\frac{\left (640 c^3 d e-105 b^3 f^2+28 b c f (10 b e+7 a f)-8 c^2 \left (32 a e f+25 b \left (e^2+2 d f\right )\right )\right ) \left (a+b x+c x^2\right )^{3/2}}{960 c^4}+\frac{\left (21 b^2 f^2-4 c f (14 b e+5 a f)+40 c^2 \left (e^2+2 d f\right )\right ) x \left (a+b x+c x^2\right )^{3/2}}{160 c^3}+\frac{f (8 c e-3 b f) x^2 \left (a+b x+c x^2\right )^{3/2}}{20 c^2}+\frac{f^2 x^3 \left (a+b x+c x^2\right )^{3/2}}{6 c}-\frac{\left (b^2-4 a c\right ) \left (128 c^4 d^2+21 b^4 f^2-56 b^2 c f (b e+a f)-32 c^3 \left (4 b d e+a \left (e^2+2 d f\right )\right )+8 c^2 \left (12 a b e f+2 a^2 f^2+5 b^2 \left (e^2+2 d f\right )\right )\right ) \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+b x+c x^2}}\right )}{1024 c^{11/2}}\\ \end{align*}
Mathematica [A] time = 0.964738, size = 657, normalized size = 1.51 \[ \frac{-f^2 \left (-15 \left (16 a^2 c^2-56 a b^2 c+21 b^4\right ) \left (2 \sqrt{c} (b+2 c x) \sqrt{a+x (b+c x)}-\left (b^2-4 a c\right ) \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+x (b+c x)}}\right )\right )+16 c^{3/2} \left (-196 a b c+120 a c^2 x-126 b^2 c x+105 b^3\right ) (a+x (b+c x))^{3/2}+2304 b c^{7/2} x^2 (a+x (b+c x))^{3/2}\right )-1920 c^4 d^2 \left (b^2-4 a c\right ) \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+x (b+c x)}}\right )-40 c^2 \left (2 d f+e^2\right ) \left (80 b c^{3/2} (a+x (b+c x))^{3/2}-3 \left (5 b^2-4 a c\right ) \left (2 \sqrt{c} (b+2 c x) \sqrt{a+x (b+c x)}-\left (b^2-4 a c\right ) \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+x (b+c x)}}\right )\right )\right )-1920 b c^3 d e \left (2 \sqrt{c} (b+2 c x) \sqrt{a+x (b+c x)}-\left (b^2-4 a c\right ) \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+x (b+c x)}}\right )\right )+8 c e f \left (-16 c^{3/2} \left (32 a c-35 b^2+42 b c x\right ) (a+x (b+c x))^{3/2}-15 b \left (7 b^2-12 a c\right ) \left (2 \sqrt{c} (b+2 c x) \sqrt{a+x (b+c x)}-\left (b^2-4 a c\right ) \tanh ^{-1}\left (\frac{b+2 c x}{2 \sqrt{c} \sqrt{a+x (b+c x)}}\right )\right )\right )+3840 c^{9/2} d^2 (b+2 c x) \sqrt{a+x (b+c x)}+3840 c^{9/2} x \left (2 d f+e^2\right ) (a+x (b+c x))^{3/2}+10240 c^{9/2} d e (a+x (b+c x))^{3/2}+6144 c^{9/2} e f x^2 (a+x (b+c x))^{3/2}+2560 c^{9/2} f^2 x^3 (a+x (b+c x))^{3/2}}{15360 c^{11/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.063, size = 1429, normalized size = 3.3 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.83322, size = 2866, normalized size = 6.57 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{a + b x + c x^{2}} \left (d + e x + f x^{2}\right )^{2}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.30159, size = 861, normalized size = 1.97 \begin{align*} \frac{1}{7680} \, \sqrt{c x^{2} + b x + a}{\left (2 \,{\left (4 \,{\left (2 \,{\left (8 \,{\left (10 \, f^{2} x + \frac{b c^{4} f^{2} + 24 \, c^{5} f e}{c^{5}}\right )} x + \frac{240 \, c^{5} d f - 9 \, b^{2} c^{3} f^{2} + 20 \, a c^{4} f^{2} + 24 \, b c^{4} f e + 120 \, c^{5} e^{2}}{c^{5}}\right )} x + \frac{80 \, b c^{4} d f + 21 \, b^{3} c^{2} f^{2} - 68 \, a b c^{3} f^{2} + 640 \, c^{5} d e - 56 \, b^{2} c^{3} f e + 128 \, a c^{4} f e + 40 \, b c^{4} e^{2}}{c^{5}}\right )} x + \frac{1920 \, c^{5} d^{2} - 400 \, b^{2} c^{3} d f + 960 \, a c^{4} d f - 105 \, b^{4} c f^{2} + 448 \, a b^{2} c^{2} f^{2} - 240 \, a^{2} c^{3} f^{2} + 640 \, b c^{4} d e + 280 \, b^{3} c^{2} f e - 928 \, a b c^{3} f e - 200 \, b^{2} c^{3} e^{2} + 480 \, a c^{4} e^{2}}{c^{5}}\right )} x + \frac{1920 \, b c^{4} d^{2} + 1200 \, b^{3} c^{2} d f - 4160 \, a b c^{3} d f + 315 \, b^{5} f^{2} - 1680 \, a b^{3} c f^{2} + 1808 \, a^{2} b c^{2} f^{2} - 1920 \, b^{2} c^{3} d e + 5120 \, a c^{4} d e - 840 \, b^{4} c f e + 3680 \, a b^{2} c^{2} f e - 2048 \, a^{2} c^{3} f e + 600 \, b^{3} c^{2} e^{2} - 2080 \, a b c^{3} e^{2}}{c^{5}}\right )} + \frac{{\left (128 \, b^{2} c^{4} d^{2} - 512 \, a c^{5} d^{2} + 80 \, b^{4} c^{2} d f - 384 \, a b^{2} c^{3} d f + 256 \, a^{2} c^{4} d f + 21 \, b^{6} f^{2} - 140 \, a b^{4} c f^{2} + 240 \, a^{2} b^{2} c^{2} f^{2} - 64 \, a^{3} c^{3} f^{2} - 128 \, b^{3} c^{3} d e + 512 \, a b c^{4} d e - 56 \, b^{5} c f e + 320 \, a b^{3} c^{2} f e - 384 \, a^{2} b c^{3} f e + 40 \, b^{4} c^{2} e^{2} - 192 \, a b^{2} c^{3} e^{2} + 128 \, a^{2} c^{4} e^{2}\right )} \log \left ({\left | -2 \,{\left (\sqrt{c} x - \sqrt{c x^{2} + b x + a}\right )} \sqrt{c} - b \right |}\right )}{1024 \, c^{\frac{11}{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]